<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<style>
    .well .form-actions {
        margin-bottom: -13px;
        margin-left: -19px;
        margin-right: -19px;
    }

    .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline {
        margin-left: 0px;
    }

    .jarviswidget.well .smart-form header {
        display: block;
    }

    .smart-form .popover {
        /*padding: 1px; !important*/
        top: 0;
    }

    .smart-form .popover-title {
        background-color: #F7F7F7;
        border-bottom: 1px solid #EBEBEB;
        border-radius: 5px 5px 0 0;
        font-size: 13px;
        font-weight: normal;
        line-height: 18px;
        margin: 0;
        padding: 8px 14px;
    }

    .smart-form .popover-content {
        padding: 9px 14px;
    }

    .btn {
        padding: 5.7px 12px;
    }

    .tile ul {
        border-bottom: 0px solid #423F3F;
        box-shadow: 0 0px 0px rgba(0, 0, 0, 0.3);
        list-style: none outside none;
        margin: 0;
        padding: 0px 0px 10px 0px;
    }

    .tile ul li {
        display: inline-block;
        width: auto;
    }

    .tile ul li .jarvismetro-tile {
        border: 0 none;
        border-radius: 0;
        margin: 0 3px 3px;
    }

    .tile ul li .jarvismetro-tile:hover {
        color: #FFFFFF;
        text-decoration: none;
    }

    .tile ul li .jarvismetro-tile:active, .tile ul li .jarvismetro-tile:focus {
        left: 0;
        top: 0;
        color: #FFFFFF;
        text-decoration: none;
    }

    .tile ul .fa-2x {
        font-size: 1.5em;
    }

    .alert .tile ul {
        border-bottom: 0 solid #423F3F;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
        list-style: none outside none;
        margin: 0;
        padding: 0px;
    }

    .alert .jarvismetro-tile {
        box-shadow: 0 0 1px #FFFFCC inset;
        height: 60px;
    }
</style>

<!-- row -->
<div class="row">
    <article class="col-sm-12 col-md-12 col-lg-12 sortable-grid ui-sortable">
        <!-- Widget ID (each widget will need unique ID)-->
        <div class="jarviswidget well" id="wid-id-3" data-widget-colorbutton="false" data-widget-editbutton="false"
             data-widget-togglebutton="false" data-widget-deletebutton="false" data-widget-fullscreenbutton="false"
             data-widget-custombutton="false" data-widget-sortable="false">
            <!-- widget options:
            usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">

            data-widget-colorbutton="false"
            data-widget-editbutton="false"
            data-widget-togglebutton="false"
            data-widget-deletebutton="false"
            data-widget-fullscreenbutton="false"
            data-widget-custombutton="false"
            data-widget-collapsed="true"
            data-widget-sortable="false"

            -->
            <header>
                <!--<span class="widget-icon"> <i class="fa fa-comments"></i> </span>-->
                <!--<h2>Default Tabs with border </h2>-->

            </header>

            <!-- widget div-->
            <div>
                <!-- widget edit box -->
                <div class="jarviswidget-editbox">
                    <!-- This area used as dropdown edit box -->

                </div>
                <!-- end widget edit box -->

                <!-- widget content -->
                <div class="widget-body ">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <span class="font-md text-primary">
                                <spring:message code="EMAIL_TITTLE"/>
                            </span>
                        </div>
                    </div>

                    <hr class="simple">
                    <!--row-->
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
                            <div id="div_test_connection" class="alert alert-success" style="display: none;">
                                <i class="fa fa-check-circle-o "></i>
                                <spring:message code="EMAIL_TEST_CONNECT_SUCCESS"/>
                            </div>
                            <form id="email-form" action="system/email/create" method="post" class="smart-form" novalidate="novalidate">
                                <fieldset>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_Name" code="EMAIL_NAME"/>
                                            ${m_Name}
                                            <span style="color: red;">*</span>
                                        </label>
                                        <label class="input">
                                            <input type="text" name="name" id="name" maxlength="<spring:message code='GLOBAL_FIELD_MAX'/>">
                                        </label>
                                    </section>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_Description" code="EMAIL_DESCRIPTION"/>
                                            ${m_Description}
                                        </label>
                                        <label class="input">
                                            <input type="text" name="description" id="description" maxlength="<spring:message code='GLOBAL_FIELD_MAX'/>">
                                        </label>
                                    </section>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_SendAddress" code="EMAIL_SEND_ADDRESS"/>
                                            ${m_SendAddress}
                                           <span style="color: red;">*</span>
                                        </label>
                                        <label class="input">
                                            <input type="text" name="sendAddress" id="sendAddress" maxlength="<spring:message code='GLOBAL_FIELD_MAX'/>">
                                        </label>
                                        <div class="note">
                                            <spring:message code="EMAIL_SEND_ADDRESS_NOTE"/>
                                        </div>
                                    </section>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_Prefix" code="EMAIL_PREFIX"/>
                                            ${m_Prefix}
                                        </label>
                                        <label class="input">
                                            <input type="text" name="prefix" id="prefix" maxlength="<spring:message code='GLOBAL_FIELD_MAX'/>" value="[ISPC]">
                                        </label>
                                        <div class="note">
                                            <spring:message code="EMAIL_PREFIX_NOTE"/>
                                        </div>
                                    </section>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_Protocol" code="EMAIL_PROTOCOL"/>
                                            ${m_Protocol}
                                        </label>
                                        <label class="select">
                                            <select name="protocol" id="protocol">
                                                <option value="smtp"><spring:message code="EMAIL_PROTOCOL_SMTP"/></option>
                                                <%--<option value="smtps"><spring:message code="EMAIL_PROTOCOL_SMTPS"/></option>--%>
                                            </select> <i></i>
                                        </label>
                                    </section>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_HostAddress" code="EMAIL_HOST_ADDRESS"/>
                                            ${m_HostAddress}
                                            <span style="color: red;">*</span>
                                        </label>
                                        <label class="input">
                                            <input type="text" name="hostAddress" id="hostAddress" maxlength="<spring:message code='GLOBAL_FIELD_MAX'/>">
                                        </label>
                                        <div class="note">
                                            <spring:message code="EMAIL_HOST_ADDRESS_NOTE"/>
                                        </div>
                                    </section>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_Port" code="EMAIL_PORT"/>
                                            ${m_Port}
                                        </label>
                                        <label class="input">
                                            <input type="text" name="port" id="port" maxlength="4" value="25">
                                        </label>
                                        <div class="note">
                                            <spring:message code="EMAIL_PORT_NOTE"/>
                                        </div>
                                    </section>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_Timeout" code="EMAIL_TIMEOUT"/>
                                            ${m_Timeout}
                                        </label>
                                        <label class="input">
                                            <input type="text" name="timeout" id="timeout" maxlength="<spring:message code='GLOBAL_FIELD_MAX'/>" value="10000">
                                        </label>
                                        <div class="note">
                                            <spring:message code="EMAIL_TIMEOUT_NOTE"/>
                                        </div>
                                    </section>
                                    <%--<section>
                                        <label class="checkbox"><input type="checkbox" name="isTLS" id="isTLS">
                                            <i></i><spring:message var="m_TLS" code="EMAIL_TLS"/>${m_TLS}
                                        </label>
                                        <div class="note">
                                            <spring:message code="EMAIL_TLS_NOTE"/>
                                        </div>
                                    </section>--%>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_Username" code="EMAIL_USERNAME"/>
                                            ${m_Username}
                                        </label>
                                        <label class="input">
                                            <input type="text" name="username" id="username" maxlength="<spring:message code='GLOBAL_FIELD_MAX'/>">
                                        </label>
                                        <div class="note">
                                            <spring:message code="EMAIL_USERNAME_NOTE"/>
                                        </div>
                                    </section>
                                    <section>
                                        <label class="label">
                                            <spring:message var="m_Password" code="EMAIL_PASSWORD"/>
                                            ${m_Password}
                                        </label>
                                        <label class="input">
                                            <input type="password" name="password" id="password" maxlength="<spring:message code='GLOBAL_FIELD_MAX'/>">
                                        </label>
                                        <div class="note">
                                            <spring:message code="EMAIL_PASSWORD_NOTE"/>
                                        </div>
                                    </section>
                                </fieldset>
                                <footer>
                                    <div class="text-right form-action-bar">
                                        <a href="#system/email" class="btn btn-default">
                                            <i class="fa fa-rotate-left"></i>&nbsp;<spring:message code="GLOBAL_BUTTON_CANCEL"/> </a>
                                        <button type="submit" class="btn btn-primary" id="btn_save">
                                            <i class="fa fa-save"></i>&nbsp;<spring:message code="GLOBAL_BUTTON_SAVE"/>
                                        </button>
                                        <button type="submit" class="btn btn-success" id="btn_test">
                                            <i class="fa fa-envelope-o"></i>&nbsp;<spring:message code="EMAIL_TEST"/>
                                        </button>
                                    </div>
                                </footer>
                                <div class="message">
                                    <i class="fa fa-check fa-lg"></i>
                                    <p>
                                        <spring:message code="GLOBAL_SUCCESS_ADDED"/>
                                    </p>
                                    <a href="#system/email/detail" id="lk_addnew">
                                        <spring:message code="GLOBAL_ADD_ANOTHER"/>
                                    </a>/
                                    <a href="#system/email">
                                        <spring:message code="GLOBAL_RETURN_BACK"/>
                                    </a>
                                </div>
                            </form>
                        </div>

                        <%--<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <hr>
                            <div class="text-center form-action-bar">
                                <a id="btn_test_connection" href="javascript:void(0);" class="btn btn-success"><i
                                        class="fa fa-envelope-o"></i> <spring:message code="EMAIL_TEST_CONNECT"/> </a>&nbsp;&nbsp;
                                <a href="#system/email/create" class="btn btn-primary">
                                    <i class="fa fa-save"></i><spring:message code="GLOBAL_BUTTON_SAVE"/>
                                </a>&nbsp;&nbsp;
                                <a href="#system/email" class="btn btn-default"><spring:message code="GLOBAL_BUTTON_CANCEL"/></a>
                            </div>
                        </div>--%>

                    </div>
                    <!--end row-->
                </div>
                <!-- end widget content -->
            </div>
            <!-- end widget div -->
        </div>
        <!-- end widget -->
    </article>

</div>
<!-- end row -->
<script src="js/core/business/email/createEmailInit.js"></script>
<%--<script src="js/plugin/form/form.bar.js"></script>--%>
<%--<script src="js/plugin/jquery-form/jquery-form.min.js"></script>--%>

<%--<script type="text/javascript">--%>

    <%--appendBreadCrumb("system/email", $.i18n.prop('EAMIL_NEW'));--%>

    <%--// open chat list--%>
    <%--$('#btn_test_connection').click(function (e) {--%>
        <%--$('#div_test_connection').fadeToggle();--%>
        <%--$('html,body').animate({scrollTop: 0}, 500);--%>

        <%--e.preventDefault();--%>
    <%--});--%>

    <%--$(document).ready(function () {--%>
        <%--$('#lk_addnew').click(function(e){--%>
            <%--$('#email-form' ).removeClass('submited');--%>
            <%--$('#email-form')[0].reset();--%>
            <%--e.preventDefault();--%>
        <%--});--%>

        <%--$('#protocol').change(function() {--%>
            <%--if($(this).val() == 'smtp'){--%>
                <%--$('#port').val(25);--%>
            <%--}else if($(this).val() == 'smtps') {--%>
                <%--$('#port').val(465);--%>
            <%--}--%>
        <%--});--%>

        <%--$('#btn_test').click(function () {--%>
            <%--$('#email-form').attr("action","system/email/testEmail");--%>
        <%--});--%>

        <%--$('#btn_save').click(function () {--%>
            <%--$('#email-form').attr("action","system/email/create");--%>
        <%--});--%>

        <%--$.formbar();--%>
    <%--});--%>

    <%--loadScript("js/core/system/createEmail.js",init);--%>
    <%--function init(){--%>
        <%--createEmail.initCreateEmail();--%>
    <%--}--%>
<%--</script>--%>

</body>

</html>